enyo.kind({
	name: "AssessmentUI_CreateResult",
	kind: "AssessmentUI_PanelBase",
	
	caption: "Assessment Result",
	submitLeftCaption: "Back to Home",
	
	components: [
		{classes: "panel-body", components: [
			{name: "messageContent", content : "", style:"margin: 5px 0px 5px 10px; font-weight: bold; font-style: italic;"}, 
			{kind : "hpit.Divider", caption : "New Request ID", collapsable: true, isExpanded: true, components : [
				{name: "requestIdContent", content : "", style: "font-weight: bold; font-style: italic;"}, 
			]},
			{kind : "hpit.Divider", caption : "Request Type", collapsable: true, isExpanded: true, components : [
				{name: "requestTypeContent", content : "", }, 
			]},
			{name:"recipientsContent", kind : "hpit.Divider", caption : "Notification Recipients", collapsable: true, isExpanded: true, components : [
			]},
		]},
	],
	
	create: function() {
		this.inherited(arguments);
		AssessmentUI_Data.current_page = this;
		this.initPanel();
	},
	
	initPanel: function() {
		
		if(AssessmentUI_Data.runImmediality && AssessmentUI_Data.saveSubscription) {
			this.$.messageContent.setContent("Subscription saved and it will run immediality!");
		} else if(AssessmentUI_Data.runImmediality) {
			this.$.messageContent.setContent("Request submitted and it will run immediality!");
		} else if(AssessmentUI_Data.saveSubscription) {
			this.$.messageContent.setContent("Subscription saved!");
		}
		
		this.$.requestIdContent.setContent(AssessmentUI_Data.newRequestID);
		
		//Show Type
		this.$.requestTypeContent.setContent(AssessmentUI_Data.selected_AnalysisTypePayload.defaultAnalysisTypeName);
		
		//Sow Recipients
		var recipientList = null;
		var recipientsContentControl = this.$.recipientsContent;
		recipientsContentControl.destroyClientControls();
		for(var i = 0; i < AssessmentUI_Data.notificationRecipients.length; i++) {
			recipientList = {content: AssessmentUI_Data.notificationRecipients[i] + ";"};
			recipientsContentControl.createComponent(recipientList, {owner: recipientsContentControl.owner});
			this.$.recipientsContent.render();
		}
	},
});